package day6;

/**
 * @author oldliu
 * @since 1.0
 */
public class BubbleSort {
    public static void main(String[] args) {
        int[] a = {21, 23, 22, 414, 734, 74, 74, 42, 88, 56, 88, 32, 23, 22, 21};
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = 0; j < a.length - 1 - i; j++) {
                if (a[j] > a[j + 1]) {
                    int temp = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = temp;
                }
            }
        }
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + "\t");
        }
        System.out.println();
    }
}
